import React, { useCallback } from 'react';
import './ConsultDoctor.scss';
import NavBar from '@/components/NavBar/NavBar';
import { Link, useNavigate } from 'react-router-dom';

const ConsultDoctor = () => {
  const navigate = useNavigate();
  // 左边插槽内容
  const left = useCallback(() => (<span>返回</span>), []);
  // 中间插槽内容
  const children = useCallback(() => (<span>问医生</span>), []);
  // 右边插槽内容
  const right = useCallback(() => (<Link to="/">问诊记录</Link>), []);

  return (
    <div className="consult-doctor">
      {/*导航栏组件*/}
      <NavBar back={left()} children={children()} right={right()} onBack={() => navigate(-1)}></NavBar>
    </div>
  );
};

export default ConsultDoctor;